package demo;

/*
 *电影的实体类,javabean的的作用
 *                          1.实体类的对象本身只负责存储对象本身的数据
 *                          2.对于数据的处理应该交给另外一个类
 *
 * */
//封装
public class Movie {
    //成员变量,属性-->封装:进行合理隐藏
    private int id;
    private String name;
    private double price;
    private String actor;

    //构造器
    //无参
    public Movie() {
    }

    //带参构造

    public Movie(int id, String name, double price, String actor) {
        this.id = id;
        this.name = name;
        this.price = price;
        this.actor = actor;
    }

    //提供对成员操作的方法

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public String getActor() {
        return actor;
    }

    public void setActor(String actor) {
        this.actor = actor;
    }
}
